<%= simple_form_for(@event) do |f| %>
  <%= f.error_notification %>

  <div class="form-inputs">
    <%= f.input :title %>
    <%= f.input :description %>
    <%= f.input :status, as: :select, collection: Event::STATUS_CHOICES %>
    <%= f.input :category, as: :select, collection: Event::CATEGORY_CHOICES %>
    <%= f.input :is_template, as: :select, collection: [true, false],
                label: "Define this event as a template" if @event.new_record? %>
    <%= f.association :template, :as => :select, collection: Event.templates,
                label: 'Base this event on a template' if @event.new_record? %>

    <div class="training-controls">
      <%= f.association :course,
                        :hint => "If the training is not for certification, do not choose a course" %>
      <%= f.input :instructor %>
    </div>
    <%= f.input :location %>
    <%= f.input :min_title, as: :select, collection: Person::TITLES %>
    <%= f.association :departments, :as => :check_boxes, include_blank: false,
                      :collection => Department.managing_people %>
    <%= f.input :id_code %>
    <%= f.input :start_time, as: :string, label: "Start Time",
                input_html: { class: "datetimepicker", size: 11,
                              value: format_datetime_value(f.object.start_time) } %>
    <%= f.input :end_time, as: :string, label: "End Time",
                input_html: { class: "datetimepicker", size: 11,
                              value: format_datetime_value(f.object.end_time) } %>
    <%= f.input :comments %>
  </div>

  <div class="form-actions">
    <%= f.button :submit %>
  </div>
<% end %>
